package st.business.tepth.business.goodsorder;

import java.util.List;

import io.reactivex.disposables.Disposable;
import st.business.tepth.base.OnDataConvertListener;
import st.business.tepth.business.bean.MaterialHadApplyBean;
import st.shadow.library.core.base.mvp.BaseModel;
import st.shadow.library.core.base.mvp.BasePresenter;
import st.shadow.library.core.base.mvp.BaseView;

/**
 * Author: shadow
 * Email:  1025431817@qq.com
 * Time:   2019-02-22 17:30
 */

public interface GoodsOrderContract {
    interface View extends BaseView {
        void showData(List<MaterialHadApplyBean> list);

        void showError(String msg);

        void showSucceed(String msg);
    }

    interface Model extends BaseModel {
        Disposable getData(String token,int repairId,
                           OnDataConvertListener<List<MaterialHadApplyBean>> listener);

        Disposable cancelOrder(String token, String items, int status,
                               OnDataConvertListener<String> cancelListener,
                               OnDataConvertListener<List<MaterialHadApplyBean>> dataListener);

        Disposable reApplyOrder(String token, String items, int status,
                                OnDataConvertListener<String> reApplyListener,
                                OnDataConvertListener<List<MaterialHadApplyBean>> dataListener);
        Disposable returnGoods(String token, String items,
                                OnDataConvertListener<String> returnListener,
                                OnDataConvertListener<List<MaterialHadApplyBean>> dataListener);
    }

    abstract class Presenter extends BasePresenter<View> {
        abstract void getData(String token,int repairId);

        //退料
        abstract void returnGoods(String token, String items);

        //领料单取消
        abstract void cancelOrder(String token, String items, int status);

        //重新申请
        abstract void reApplyOrder(String token, String items, int status);
    }
}
